package com.webchat.rmi.pgc.sys;


import com.webchat.common.bean.APIPageResponseBean;
import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.sys.SysDataDictionaryCategoryRequestVO;
import com.webchat.domain.vo.response.sys.SysDataDictionaryCategoryBaseVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 数据字典分类 远程调用接口
 *
 * @author SongRenShuo
 * @date 2025/06/25
 */
@FeignClient(name = "webchat-pgc-service",
        contextId = "sysDataDictionaryCategoryClient",
        configuration = RpcRequestInterceptor.class)
public interface SysDataDictionaryCategoryClient {


    /**
     * 创建或者更新数据字典分类
     *
     * @param requestVO 请求 VO
     * @return {@link APIResponseBean }<{@link Long }>
     */
    @PostMapping("/pgc-service/sys/data-dictionary/category/save")
    APIResponseBean<Long> save(@RequestBody SysDataDictionaryCategoryRequestVO requestVO);

    /**
     * 删除数据字典分类
     *
     * @param categoryId 主键
     * @param userId     用户 ID
     * @return {@link APIResponseBean }<{@link Boolean }>
     */
    @PostMapping("/pgc-service/sys/data-dictionary/category/delete/{categoryId}/{userId}")
    APIResponseBean<Boolean> delete(@PathVariable Long categoryId,@PathVariable String userId);

    /**
     * 分页查询数据字典分类
     *
     * @param code     编号
     * @param name     名称
     * @param pageNo   页码
     * @param pageSize 每页条数
     * @return {@link APIPageResponseBean }<{@link SysDataDictionaryCategoryBaseVO }>
     */
    @GetMapping("/pgc-service/sys/data-dictionary/category/page")
    APIPageResponseBean<SysDataDictionaryCategoryBaseVO> page(@RequestParam(value = "code", required = false) String code,
                                                              @RequestParam(value = "name", required = false) String name,
                                                              @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                                              @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize);

    /**
     * 列表查询 - 数据字典分类
     *
     * @return {@link APIResponseBean }<{@link List }<{@link SysDataDictionaryCategoryBaseVO }>>
     */
    @GetMapping("/pgc-service/sys/data-dictionary/category/list")
    APIResponseBean<List<SysDataDictionaryCategoryBaseVO>> list();
}
